﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;


namespace IHISCETeim.Web.MachineSys.MacModel
{
    public partial class OUnsuitableProdUpdateClaimAnalyze : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看 };
            }
        }
        protected override string DWZRef
        {
            get { return "OUnsuitableProdList"; }
        }


        /// <summary>
        /// 需要修改的ID
        /// </summary>
        protected int UnsuitabledID
        {
            get
            {
                return GetRequestValue<int>("UnsuitabledID", 0);
            }
        }


        private OUnsuitableProdInfo _obj;
        protected OUnsuitableProdInfo obj
        {
            get
            {
                if (_obj == null)
                {
                    _obj = OUnsuitableProdController.GetById(UnsuitabledID);
                }
                return _obj;
            }
        }


        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "edit")
            {
                addmenu();
            }

        }


        private void addmenu()
        {
            // UClaimDemageControlInfo obj = Request.SerializableObject<UClaimDemageControlInfo>();
            OUnsuitableProdInfo objU = Request.SerializableObject<OUnsuitableProdInfo>();


            this.AddLog(Permission.不适合品处理票_收入差异, objU);

            bool r = OUnsuitableProdController.UpdateClaim(objU);
            if (r)
                SuccessAlertJson("提交索赔收入差异分析信息成功");
            else
            {
                ErrorJson("提交索赔收入差异分析信息失败", this.DWZRef);
            }
        }
    }
}